package com.yellow.dispatchservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yellow.dispatchservice.entity.Vehicle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface VehicleMapper extends BaseMapper<Vehicle> {

    @Select("select * from vehicles as v inner join  vehicle_assignments as va on va.vehicle_id = v.vehicle_id where courier_id = #{courierId}")
    Vehicle getVehicleByCourierId(@Param(value = "courierId") Integer courierId);
}
